﻿using System;

namespace YiHaoHospitalPlatform.Model
{
    public class Department:BaseModel
    {
        /// <summary>
        /// 科室、病区、部门代码
        /// </summary>
        public string DepartmentId { get; set; }
        /// <summary>
        /// 科室、病区、部门代码
        /// </summary>
        public string DepartmentName { get; set; }

        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return false;
            }
            if ((obj.GetType().Equals(this.GetType())) == false)
            {
                return false;
            }
            Department temp = null;
            temp = (Department)obj;

            return this.DepartmentId.Equals(temp.DepartmentId) && this.DepartmentName.Equals(temp.DepartmentName);
        }

        //重写GetHashCode方法（重写Equals方法必须重写GetHashCode方法，否则发生警告
        public override int GetHashCode()
        {
            return this.DepartmentId.GetHashCode() + this.DepartmentName.GetHashCode();
        }
    }
}
